package com.chao.rabbitmq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class TestConsumer {

    @RabbitListener(bindings = @QueueBinding(
            key = {"confirm-routing-key","tx-routing-key"},
            value = @Queue(value = "test-confirm-queue",durable = "true"),
            exchange = @Exchange(value = "default-exchange",
                    ignoreDeclarationExceptions = "true")
    ))
    public void saveSeed(String msg) {
        log.info("接收到消息：{}",msg);
    }
}
